<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('thegioihiend','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',

//    'defaultController' => 'index.html',

    // preloading 'log' component
//    'preload' => array('log'),

    // path aliases
    'aliases' => array(
        'Twilio' => realpath(__DIR__ . '/../extensions/twilio/Services'),
    ),

    'behaviors' => array(
        'runEnd' => array(
            'class' => 'application.components.WebApplicationEndBehavior',
        ),
    ),

    'import' => array(
        'application.models.*',
        'application.models.user.*',
        'application.components.*',
        'application.components.enumerations.*',
        'application.components.widgets.*',
        'application.helpers.*',
        'application.services.*',
        'application.extensions.oauthServer.*',
        'application.extensions.crontab.*',
        'application.extensions.eUploadImage.*',
        'application.extensions.feed.*',
        'application.extensions.reCaptcha.*',
        'application.extensions.recaptcha-php-1.11.*',
        'application.extensions.yiiexcel.*',
        'application.vendors.phpexcel.*',

    ),

    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'password',
            'generatorPaths' => array('bootstrap.gii'),
        ),
    ),

    // application components
//    'preload' => array('log'),
    'components' => array(

        'mailer' => array(
            'class' => 'application.extensions.mailer.EMailer',
            'pathViews' => 'application.views.email',
            'pathLayouts' => 'application.views.email.layouts'
        ),

        'cache' => array(
            'class' => 'system.caching.CDbCache'
        ),

        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
            'loginUrl' => 'login',
            'class' => 'WebUser',
        ),

        'configuration' => array(
            'class' => 'application.components.Configuration'
        ),

        'errorHandler' => array( // use 'site/error' action to display errors
//            'errorAction' => 'site/error',
        ),

        'db' => require(dirname(__FILE__) . '/database.php'),
        'urlManager' => require(dirname(__FILE__) . '/routes.php'),
        //        'log' => require(dirname(__FILE__) . '/log.php'),

    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => require(dirname(__FILE__) . '/params.php'),
);